exports.addDkp = function (req, res) {

  var bodyParams = req.routeInfo.bodyParams;

  //循环操作的人员
  var tasks = [];

  bodyParams.memberArr.forEach(function (item, i) {

    tasks.push(function (callback) {

      //获取时间戳
      var nowTime = Date.parse(new Date(bodyParams.nowDate)) / 1000;

      //判断操作类型
      if (bodyParams.actionType == 0) {

        //新增记录
        db.add({

          "ir_type": 0,
          "ir_number": bodyParams.dkpValue,
          "ir_equipment_name": "副本活动BOSS击杀",
          "ir_mid": item,
          "ir_create_time": nowTime

        }, "dkp_integral_record", function (rs) {


          //更新相应人员DKP
          db.where({ m_id: item }).updateNumInc("m_integral", bodyParams.dkpValue, "dkp_member", function (resp) {

            callback();

          });
        })


      } else {

        //更新相应人员DKP
        db.where({ m_id: item }).updateNumDec("m_integral", bodyParams.dkpValue, "dkp_member", function (resp) {

          callback();

        });

      }

    });

  });

  async.waterfall(tasks, function () {

    RES.successResponse(res);

  });




}